<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 7.3.0">

  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next-haha.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next-haha.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next-haha.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.0/css/all.min.css" integrity="sha256-VHqXKFhhMxcpubYf9xiWdCiojEbY9NexQ4jh8AxbvcM=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">

<script class="next-config" data-name="main" type="application/json">{"hostname":"ming.theyan.gs","root":"/","images":"/images","scheme":"Pisces","darkmode":false,"version":"8.25.0","exturl":false,"sidebar":{"position":"left","width_expanded":320,"width_dual_column":240,"display":"post","padding":18,"offset":12},"hljswrap":true,"codeblock":{"theme":{"light":"default","dark":"stackoverflow-dark"},"prism":{"light":"prism","dark":"prism-dark"},"copy_button":{"enable":false,"style":null},"fold":{"enable":false,"height":500},"language":false},"bookmark":{"enable":true,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":false,"duration":200,"transition":{"menu_item":"fadeInDown","post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"/search.xml","localsearch":{"enable":true,"top_n_per_article":1,"unescape":false,"preload":false,"trigger":"auto"}}</script><script src="/js/config.js" defer></script>

    <meta name="description" content="好记性比不过烂笔头">
<meta property="og:type" content="website">
<meta property="og:title" content="运维烂笔头">
<meta property="og:url" content="https://ming.theyan.gs/page/8/index.html">
<meta property="og:site_name" content="运维烂笔头">
<meta property="og:description" content="好记性比不过烂笔头">
<meta property="og:locale" content="zh_CN">
<meta property="article:author" content="老杨">
<meta name="twitter:card" content="summary">


<link rel="canonical" href="https://ming.theyan.gs/page/8/">


<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":true,"isPost":false,"lang":"zh-CN","comments":"","permalink":"","path":"page/8/index.html","title":""}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>运维烂笔头 - 一个 SA 老兵的工作日志</title>
  
    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-106574959-2"></script>
  <script class="next-config" data-name="google_analytics" type="application/json">{"tracking_id":"UA-106574959-2","only_pageview":false,"measure_protocol_api_secret":null}</script>
  <script src="/js/third-party/analytics/google-analytics.js" defer></script>

  <script src="/js/third-party/analytics/baidu-analytics.js" defer></script>
  <script async src="https://hm.baidu.com/hm.js?fdef9ded31bdb8b2dab08eddebdd5fed"></script>







  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous" defer></script>
<script src="/js/utils.js" defer></script><script src="/js/motion.js" defer></script><script src="/js/sidebar.js" defer></script><script src="/js/next-boot.js" defer></script><script src="/js/bookmark.js" defer></script>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/hexo-generator-searchdb/1.5.0/search.js" integrity="sha256-xFC6PJ82SL9b3WkGjFavNiA9gm5z6UBxWPiu4CYjptg=" crossorigin="anonymous" defer></script>
<script src="/js/third-party/search/local-search.js" defer></script>







  




<!-- google adsense -->
<script data-ad-client="ca-pub-1045025618858716" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
<link rel="alternate" href="/atom.xml" title="运维烂笔头" type="application/atom+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <div class="column">
      <header class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <h1 class="site-title">运维烂笔头</h1>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">一个 SA 老兵的工作日志</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger" aria-label="搜索" role="button">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-projects"><a href="/projects" rel="section"><i class="fa fa-code fa-fw"></i>projects</a></li><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a></li><li class="menu-item menu-item-about"><a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a></li><li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a></li><li class="menu-item menu-item-sitemap"><a href="/sitemap.xml" rel="section"><i class="fa fa-sitemap fa-fw"></i>站点地图</a></li><li class="menu-item menu-item-commonweal"><a href="/404/" rel="section"><i class="fa fa-heartbeat fa-fw"></i>公益 404</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
      <div class="search-header">
        <span class="search-icon">
          <i class="fa fa-search"></i>
        </span>
        <div class="search-input-container">
          <input autocomplete="off" autocapitalize="off" maxlength="80"
                placeholder="搜索..." spellcheck="false"
                type="search" class="search-input">
        </div>
        <span class="popup-btn-close" role="button">
          <i class="fa fa-times-circle"></i>
        </span>
      </div>
      <div class="search-result-container">
        <div class="search-result-icon">
          <i class="fa fa-spinner fa-pulse fa-5x"></i>
        </div>
      </div>
    </div>
  </div>

</header>
        
  
  <aside class="sidebar">

    <div class="sidebar-inner sidebar-overview-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">老杨</p>
  <div class="site-description" itemprop="description">好记性比不过烂笔头</div>
</div>
<div class="site-state-wrap animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">114</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">8</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
          <a href="/tags/">
        <span class="site-state-item-count">509</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author animated">
      <span class="links-of-author-item">
        <a href="https://github.com/haw-haw" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;haw-haw" rel="noopener me" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:blog@theyan.gs" title="E-Mail → mailto:blog@theyan.gs" rel="noopener me" target="_blank"><i class="fa fa-envelope fa-fw"></i>E-Mail</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://weibo.com/u/1494877243" title="Weibo → https:&#x2F;&#x2F;weibo.com&#x2F;u&#x2F;1494877243" rel="noopener me" target="_blank"><i class="fab fa-weibo fa-fw"></i>Weibo</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://twitter.com/6fool" title="Twitter → https:&#x2F;&#x2F;twitter.com&#x2F;6fool" rel="noopener me" target="_blank"><i class="fab fa-twitter fa-fw"></i>Twitter</a>
      </span>
  </div>

        </div>
      </div>
    </div>

    
    <div class="sidebar-inner sidebar-blogroll">
      <div class="links-of-blogroll animated">
        <div class="links-of-blogroll-title"><i class="fa fa-globe fa-fw"></i>
          链接
        </div>
        <ul class="links-of-blogroll-list">
            <li class="links-of-blogroll-item">
              <a href="https://bad-pencil.github.io/" title="https:&#x2F;&#x2F;bad-pencil.github.io" rel="noopener" target="_blank">github 镜像站</a>
            </li>
            <li class="links-of-blogroll-item">
              <a href="https://hawhaw.gitee.io/" title="https:&#x2F;&#x2F;hawhaw.gitee.io" rel="noopener" target="_blank">gitee 镜像站</a>
            </li>
        </ul>
      </div>
    </div>
  </aside>


    </div>

    <div class="main-inner index posts-expand">

    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://ming.theyan.gs/2018/07/%E5%88%86%E4%BA%AB%E4%B8%80%E4%BA%9B%E8%87%AA%E5%B7%B1DIY%E7%9A%84task%E7%9A%84profile/index.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="老杨">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="运维烂笔头">
      <meta itemprop="description" content="好记性比不过烂笔头">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content=" | 运维烂笔头">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2018/07/%E5%88%86%E4%BA%AB%E4%B8%80%E4%BA%9B%E8%87%AA%E5%B7%B1DIY%E7%9A%84task%E7%9A%84profile/index.html" class="post-title-link" itemprop="url">分享一些自己DIY的Tasker的profile</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2018-07-25 19:29:55" itemprop="dateCreated datePublished" datetime="2018-07-25T19:29:55+08:00">2018-07-25</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2018-07-26 07:22:45" itemprop="dateModified" datetime="2018-07-26T07:22:45+08:00">2018-07-26</time>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h1 id="缘起"><a href="#缘起" class="headerlink" title="缘起"></a>缘起</h1><h2 id="about-Tasker"><a href="#about-Tasker" class="headerlink" title="about Tasker"></a>about Tasker</h2><p>早先通过 <strong>Google Opinion Rewards</strong> 做调查挣了小几美刀，于是就购买了 <strong>Google Play Store</strong> 下的第一个收费软件：<a href="https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm&amp;hl=en_US" target="_blank" rel="noopener">Tasker</a>。但后来由于种种原因，<strong>Tasker</strong> 一直没有真正用起来（我最看重的几个功能都实现的不好）。</p>
<h2 id="about-IFTTT"><a href="#about-IFTTT" class="headerlink" title="about IFTTT"></a>about IFTTT</h2><p>一直在用 <strong>IFTTT</strong> 的一个功能：每日抓取 <strong>NASA</strong> 的图回来做 Android 手机的 Wallpaper，但最近同时用两个 Android 手机，不希望两个手机同时一样的 Wallpaper，但这个需求如果用 <strong>IFTTT</strong> 来做只能每台 Android 手机用单独的账号来实现，这个实现显然太丑陋了。</p>
<h1 id="最终方案"><a href="#最终方案" class="headerlink" title="最终方案"></a>最终方案</h1><p><strong>Tasker</strong> 官方其实有一个放出来的 profile，是来抓 <strong>reddit</strong> 的图的，但那是几年前的东西了，现在几乎没法用，但作为例子，这个 profile 处理这种问题的思路是可以借鉴的。于是我就修改了下这个 profile，实现了抓 reddit.com/r/wallpaper 和 reddit.com/r/pic 以及 <a href="https://www.nasa.gov/multimedia/imagegallery/iotd.html" target="_blank" rel="noopener">NASA iotd(Image of the Day)</a> 的功能。</p>
<h1 id="about-tasker-profile"><a href="#about-tasker-profile" class="headerlink" title="about tasker_profile"></a>about tasker_profile</h1><p>上面提到的这个 profile，我放到了 <a href="https://github.com/haw-haw/tasker_profile" target="_blank" rel="noopener">github</a> 下面了，这里远期还会放一些 <strong>Tasker</strong> 可用的、实现了一些实用好玩儿功能的 profile，但是暂时，就这么一个 profile，叫“Wallpaper”，意思是更系统 Wallpaper 相关的一个 profile。使用起来也不难，<a href="https://github.com/haw-haw/tasker_profile/blob/master/README.md" target="_blank" rel="noopener">README.md</a> 里都有提到。</p>
<h1 id="写在最后"><a href="#写在最后" class="headerlink" title="写在最后"></a>写在最后</h1><p>如果我辛苦折腾的这个东西真能帮上你的忙，请帮我给项目点赞吧，谢谢！</p>

      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://ming.theyan.gs/2018/06/%E5%9C%A8Ubuntu16-04%E4%B8%8A%E9%83%A8%E7%BD%B2Zabbix-proxy3-4%E7%9A%84%E6%B5%81%E6%B0%B4%E8%B4%A6/index.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="老杨">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="运维烂笔头">
      <meta itemprop="description" content="好记性比不过烂笔头">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content=" | 运维烂笔头">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2018/06/%E5%9C%A8Ubuntu16-04%E4%B8%8A%E9%83%A8%E7%BD%B2Zabbix-proxy3-4%E7%9A%84%E6%B5%81%E6%B0%B4%E8%B4%A6/index.html" class="post-title-link" itemprop="url">在Ubuntu16.04上部署Zabbix-proxy3.4的流水账</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2018-06-09 13:42:53" itemprop="dateCreated datePublished" datetime="2018-06-09T13:42:53+08:00">2018-06-09</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2018-06-15 17:48:02" itemprop="dateModified" datetime="2018-06-15T17:48:02+08:00">2018-06-15</time>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h1 id="WHY"><a href="#WHY" class="headerlink" title="WHY"></a>WHY</h1><p>这里的为什么不是说为什么要装 <strong>zabbix-proxy</strong> 的问题，而是说为什么要写这篇文章。<br>为什么要写这篇文章呢？答案很简单，官方文档太碎了，东一榔头西一棒子，一个简单实际直接的问题：怎样在 <strong>ubuntu</strong> 上安装部署 <strong>zabbix-proxy</strong>，翻官方文档得翻四五篇文档，而且这四五篇文档中还有很多干扰信息，需要仔细分辨，否则会对部署造成负面影响。<br>所以，就有了这篇“流水账”。</p>
<h1 id="HOWTO"><a href="#HOWTO" class="headerlink" title="HOWTO"></a>HOWTO</h1><h2 id="INSTALLATION"><a href="#INSTALLATION" class="headerlink" title="INSTALLATION"></a>INSTALLATION</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 安装 zabbix 官方的 ubuntu 16.04(版本号 xenial) 的软件仓</span></span><br><span class="line">wget \</span><br><span class="line">    https://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1+xenial_all.deb;</span><br><span class="line">dpkg -i zabbix-release_3.4-1+xenial_all.deb;</span><br><span class="line">apt-get update;</span><br><span class="line"><span class="comment"># 安装 zabbix-proxy 所需之 mysql 数据库服务器软件</span></span><br><span class="line"><span class="comment"># 注意这一步会让设置 mysql 服务器的 root 密码（不是系统密码！）</span></span><br><span class="line"><span class="comment"># 这个要记住，在执行下一步操作的时候要输入的</span></span><br><span class="line">apt-get install mysql-server-5.7;</span><br></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 用 root 身份连入 mysql 数据库系统并进入交互式模式</span></span><br><span class="line"><span class="comment"># 注意：这里需要输入上一步设置的 root 的密码</span></span><br><span class="line">mysql -uroot -p</span><br></pre></td></tr></table></figure>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"># 创建 zabbix-proxy 系统所用数据库：zabbix</span><br><span class="line">create database zabbix character set utf8 collate utf8_bin;</span><br><span class="line"># 创建 zabbix-proxy 应用所用数据库账号：zabbix 并其密码以及响应权限</span><br><span class="line">grant all privileges on zabbix.* to zabbix@localhost identified by &apos;zabbix&apos;;</span><br><span class="line"># 使权限及时生效</span><br><span class="line">flush privileges;</span><br><span class="line"># 退出 mysql 交互式环境</span><br><span class="line">quit</span><br></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 安装一些 zabbix-proxy 系统可能会需要</span></span><br><span class="line"><span class="comment"># 但又未在 zabbix-proxy-mysql 软件包里</span></span><br><span class="line"><span class="comment"># 明确指定依赖的软件包，</span></span><br><span class="line"><span class="comment"># 这里对于有用 snmp 监控网络设备的场景来讲非常重要</span></span><br><span class="line"><span class="comment"># 因为缺省是不会安装 snmp-mibs-downloader 之类</span></span><br><span class="line"><span class="comment"># 必须的软件包的。</span></span><br><span class="line"><span class="comment"># 注意，同时也安装上了 zabbix-agent，这个是无所谓的，</span></span><br><span class="line"><span class="comment"># 毕竟，所有的服务器都要装 zabbix-agent 不是吗</span></span><br><span class="line">apt-get install \</span><br><span class="line">    libsnmp-base \</span><br><span class="line">    snmp-mibs-downloader \</span><br><span class="line">    snmp \</span><br><span class="line">    libsnmp30 \</span><br><span class="line">    zabbix-proxy-mysql \</span><br><span class="line">    zabbix-agent;</span><br><span class="line"><span class="comment"># 创建 zabbix-proxy 需要的数据库结构及一些初始数据</span></span><br><span class="line">zcat \</span><br><span class="line">    /usr/share/doc/zabbix-proxy-mysql/schema.sql.gz \</span><br><span class="line">     | mysql -uzabbix -p zabbix;</span><br></pre></td></tr></table></figure>
<h2 id="CONFIGURATION"><a href="#CONFIGURATION" class="headerlink" title="CONFIGURATION"></a>CONFIGURATION</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 修改 zabbix proxy 的设置文件</span></span><br><span class="line">vim /etc/zabbix/zabbix_proxy.conf</span><br></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 修改 zabbix agent 的配置文件</span></span><br><span class="line"><span class="comment"># 本来这个不是本文讨论的重点</span></span><br><span class="line"><span class="comment"># 只是部署 zabbix proxy 时都会部署 zabbix agent</span></span><br><span class="line">vim /etc/zabbix/zabbix_agentd.conf</span><br></pre></td></tr></table></figure>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 最后，将几个服务设为自启动</span></span><br><span class="line">systemctl <span class="built_in">enable</span> mysql.service;</span><br><span class="line">systemctl <span class="built_in">enable</span> zabbix-proxy.service;</span><br><span class="line">systemctl <span class="built_in">enable</span> zabbix-agent.service;</span><br></pre></td></tr></table></figure>

      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://ming.theyan.gs/2018/05/%E4%BB%8Eapt-get%E5%87%BA%E6%8A%93%E5%8F%96binary-i386-Packages-gz%E5%A4%B1%E8%B4%A5%E7%9A%84%E9%94%99%E8%AF%AF%E8%AF%B4%E5%BC%80%E5%8E%BB/index.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="老杨">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="运维烂笔头">
      <meta itemprop="description" content="好记性比不过烂笔头">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content=" | 运维烂笔头">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2018/05/%E4%BB%8Eapt-get%E5%87%BA%E6%8A%93%E5%8F%96binary-i386-Packages-gz%E5%A4%B1%E8%B4%A5%E7%9A%84%E9%94%99%E8%AF%AF%E8%AF%B4%E5%BC%80%E5%8E%BB/index.html" class="post-title-link" itemprop="url">从apt-get出抓取binary-i386/Packages.gz失败的错误说开去</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2018-05-13 15:01:34" itemprop="dateCreated datePublished" datetime="2018-05-13T15:01:34+08:00">2018-05-13</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2018-05-30 10:23:34" itemprop="dateModified" datetime="2018-05-30T10:23:34+08:00">2018-05-30</time>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h1 id="起因"><a href="#起因" class="headerlink" title="起因"></a>起因</h1><p>服务器上用 <strong>apt-mirror</strong> 来拉取某些软件官方的 <strong>apt</strong> 仓并本地建仓，用于本地服务器的软件安装和更新，这个大概也是众多运维工程师曾经做过的事情吧。</p>
<p>今天我在某一台服务器上做 <strong>apt-get update</strong> 时出错了，系统报 “<a href="http://xxx.xx.xx.xx/xxxxxxxxxxxxxxxxxxx/binary-i386/Packages.gz”" target="_blank" rel="noopener">http://xxx.xx.xx.xx/xxxxxxxxxxxxxxxxxxx/binary-i386/Packages.gz”</a> 抓取失败。xxx.xx.xx.xx 是我自己建的 <strong>apt</strong> 仓，用来服务于内部服务器的，xxxxxxxxxxxxxxxxxxx 正是自建仓的路径，这下面当然没有 <strong>binary-i386</strong> 目录，因为服务器都是 <strong>x86_64</strong> 架构的，应该使用的是目录 <strong>binary-amd64</strong> 才对。</p>
<h1 id="环境介绍"><a href="#环境介绍" class="headerlink" title="环境介绍"></a>环境介绍</h1><p>出错的服务器的操作系统是：<em>Ubuntu 16.04.5 LTS (GNU/Linux 4.15.0-13-generic x86_64)</em></p>
<ol>
<li>apt 的配置文件里没有关于 i386 的设置</li>
<li>source 里也没有关于 i386 的设置</li>
</ol>
<h1 id="原因简介"><a href="#原因简介" class="headerlink" title="原因简介"></a>原因简介</h1><p><strong>Ubuntu</strong> 的 <strong>amd64</strong> 系统中，<strong>i386</strong> 是作为额外的体系结构被支持的。证据如下：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">dpkg --<span class="built_in">print</span>-architecture;dpkg --<span class="built_in">print</span>-foreign-architectures</span><br></pre></td></tr></table></figure>
<p>会输出“amd64”和”i386”。</p>
<p>所以 <strong>apt</strong> 缺省是希望 <strong>apt</strong> 仓也同时能提供 <strong>i386</strong> 的软件包。而我用 <strong>apt-mirror</strong> 建仓时，没有指定同步抓取 <strong>i386</strong> 的软件包，故而当服务器来抓取 <strong>i386</strong> 相关数据时会出错（因为的确没有哇）。</p>
<h1 id="解决方法"><a href="#解决方法" class="headerlink" title="解决方法"></a>解决方法</h1><p>知道原因了以后解决起来相对就简单了，在 <strong>apt-mirror</strong> 的配置文件 <strong>/etc/apt/mirror.list</strong> 中将想要同步抓取的软件多写一行，用 deb-i386 替换 deb，然后再跑下 </p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">apt-mirror</span><br></pre></td></tr></table></figure>
<p>就会同时同步 <strong>i386</strong> 的软件包下来，这样客户端 <strong>apt-get</strong> 时就不会有错了。</p>
<h1 id="进阶阅读"><a href="#进阶阅读" class="headerlink" title="进阶阅读"></a>进阶阅读</h1><p>可以让 <strong>x86_64</strong> 系统架构的服务器仅安装 <strong>amd64</strong> 的软件吗？这样 <strong>apt-get</strong> 时也不会去抓群 <strong>i386</strong> 相关的东西了，这样的话也可以避免上面的错误。</p>
<p>回答是：当然可以！</p>
<p>首先，干掉系统现有的所有 <strong>i386</strong> 的软件包<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">apt-get purge <span class="string">".*:i386"</span></span><br></pre></td></tr></table></figure></p>
<p>接着，将 <strong>i386</strong> 从支持的体系结构里删掉<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">dpkg --remove-architecture i386</span><br></pre></td></tr></table></figure></p>
<p>这样也可以达到目的！ </p>

      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://ming.theyan.gs/2018/03/%E4%B8%80%E6%AC%A1powerdns%E4%B8%8A%E6%9F%90%E4%B8%AAzone%E4%BC%A0%E8%BE%93%E5%A4%B1%E8%B4%A5%E7%9A%84%E9%97%AE%E9%A2%98%E7%9A%84%E8%A7%A3%E5%86%B3%E8%BF%87%E7%A8%8B/index.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="老杨">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="运维烂笔头">
      <meta itemprop="description" content="好记性比不过烂笔头">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content=" | 运维烂笔头">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2018/03/%E4%B8%80%E6%AC%A1powerdns%E4%B8%8A%E6%9F%90%E4%B8%AAzone%E4%BC%A0%E8%BE%93%E5%A4%B1%E8%B4%A5%E7%9A%84%E9%97%AE%E9%A2%98%E7%9A%84%E8%A7%A3%E5%86%B3%E8%BF%87%E7%A8%8B/index.html" class="post-title-link" itemprop="url">一次powerdns上某个zone传输失败的问题的解决过程</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2018-03-12 17:06:04" itemprop="dateCreated datePublished" datetime="2018-03-12T17:06:04+08:00">2018-03-12</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2018-03-15 17:48:02" itemprop="dateModified" datetime="2018-03-15T17:48:02+08:00">2018-03-15</time>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h1 id="缘起"><a href="#缘起" class="headerlink" title="缘起"></a>缘起</h1><p>我司用 <a href="https://www.powerdns.com/" target="_blank" rel="noopener">PowerDNS</a> 来维护域名，某天否然发现有纪录在 PowerDNS 已经更新了，但是客户端查询解析结果却迟迟没有更新。</p>
<h1 id="排查问题"><a href="#排查问题" class="headerlink" title="排查问题"></a>排查问题</h1><h2 id="请求传输数据的一端"><a href="#请求传输数据的一端" class="headerlink" title="请求传输数据的一端"></a>请求传输数据的一端</h2><p>在用做 dns 查询用的服务器上（也是 PowerDNS），执行：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pdns_control reload;</span><br></pre></td></tr></table></figure>
<p>然后在 log 里看到有错误输出：</p>
<blockquote>
<p>Unable to AXFR zone ‘in-addr.arpa’ from remote ‘1.1.1.1’ (resolver): Remote nameserver closed TCP connection</p>
</blockquote>
<p>(1.1.1.1 是主 DNS 服务器)</p>
<p>看了些文档，说有可能是数据文件太大导致传输失败，于是有直接测试了一下传输 zone：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">dig <span class="keyword">in</span>-addr.arpa @1.1.1.1 AXFR;</span><br></pre></td></tr></table></figure>
<p>结果发现还是未能得到整个 zone 的数据，于是怀疑服务器端可能有问题。</p>
<h2 id="在传输数据的一端"><a href="#在传输数据的一端" class="headerlink" title="在传输数据的一端"></a>在传输数据的一端</h2><p>在主 DNS 服务器上（这里应该是 1.1.1.1），查看 log，发现有报错误：</p>
<blockquote>
<p>Exception: All data was not consumed<br>TCP Connection Thread died because of STL error: All data was not consumed</p>
</blockquote>
<p>仔细看了下文档，说有可能是待传输的 zone 的数据文件有问题，于是我又做了下检测：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pdnsutil check-zone <span class="keyword">in</span>-addr.arpa;</span><br></pre></td></tr></table></figure>
<p>发现一堆的数据（解析纪录）显然有问题，都备份好，然后删除之。</p>
<p>然后一一回头测试，这回都正常了。</p>
<h1 id="问题根源"><a href="#问题根源" class="headerlink" title="问题根源"></a>问题根源</h1><p>肯定是大家瞎改反向解析（in-addr.arpa）的数据记录导致的。</p>

      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://ming.theyan.gs/2018/01/Nginx%20%E4%B8%8B%E5%90%AF%E7%94%A8%20HSTS/index.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="老杨">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="运维烂笔头">
      <meta itemprop="description" content="好记性比不过烂笔头">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content=" | 运维烂笔头">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2018/01/Nginx%20%E4%B8%8B%E5%90%AF%E7%94%A8%20HSTS/index.html" class="post-title-link" itemprop="url">Nginx 下启用 HSTS</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2018-01-25 15:51:20" itemprop="dateCreated datePublished" datetime="2018-01-25T15:51:20+08:00">2018-01-25</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2019-04-05 07:47:07" itemprop="dateModified" datetime="2019-04-05T07:47:07+08:00">2019-04-05</time>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h1 id="What-is-HSTS"><a href="#What-is-HSTS" class="headerlink" title="What is HSTS"></a>What is HSTS</h1><blockquote>
<p>HTTP Strict Transport Security (HSTS) is a web security policy mechanism which helps to protect websites against protocol downgrade attacks and cookie hijacking. It allows web servers to declare that web browsers (or other complying user agents) should only interact with it using secure HTTPS connections,[1] and never via the insecure HTTP protocol. HSTS is an IETF standards track protocol and is specified in RFC 6797.</p>
</blockquote>
<blockquote>
<p>The HSTS Policy is communicated by the server to the user agent via an HTTPS response header field named “Strict-Transport-Security”.[2] HSTS Policy specifies a period of time during which the user agent should only access the server in a secure fashion.[3]</p>
</blockquote>
<p>以上来自于<a href="https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security" target="_blank" rel="noopener">维基百科</a></p>
<p>大概意思是说 HSTS 是一个 web 安全策略装置，用于保护 web 站点免受协议降级攻击和 cookie 劫持。</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2018/01/Nginx%20%E4%B8%8B%E5%90%AF%E7%94%A8%20HSTS/index.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://ming.theyan.gs/2018/01/Linux%20shell%20%E4%B8%8B%E4%BD%BF%E7%94%A8%E4%BB%A3%E7%90%86%EF%BC%88Proxy%EF%BC%89%E4%B8%8A%E7%BD%91%E7%9A%84%E8%AE%BE%E7%BD%AE%E6%96%B9%E5%BC%8F/index.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="老杨">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="运维烂笔头">
      <meta itemprop="description" content="好记性比不过烂笔头">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content=" | 运维烂笔头">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2018/01/Linux%20shell%20%E4%B8%8B%E4%BD%BF%E7%94%A8%E4%BB%A3%E7%90%86%EF%BC%88Proxy%EF%BC%89%E4%B8%8A%E7%BD%91%E7%9A%84%E8%AE%BE%E7%BD%AE%E6%96%B9%E5%BC%8F/index.html" class="post-title-link" itemprop="url">Linux shell 下使用代理（Proxy）上网的设置方式</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2018-01-15 15:51:20" itemprop="dateCreated datePublished" datetime="2018-01-15T15:51:20+08:00">2018-01-15</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2019-04-05 07:47:07" itemprop="dateModified" datetime="2019-04-05T07:47:07+08:00">2019-04-05</time>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h1 id="缘起"><a href="#缘起" class="headerlink" title="缘起"></a>缘起</h1><p>我厂办公室测试小机房有一些运算资源，但是其网络是不能直接上公网的，而是通过一个内部代理（内部域名是：proxy.xxxdev.com，端口 3128）来上公网的。</p>
<p>但是现在部署环境，多半需要在命令行下折腾，而且还多半需要不停的从公网下东西（安装），所以，怎样在命令行下（shell 里）使用代理来上公网就成了一个绕不开的话题……</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2018/01/Linux%20shell%20%E4%B8%8B%E4%BD%BF%E7%94%A8%E4%BB%A3%E7%90%86%EF%BC%88Proxy%EF%BC%89%E4%B8%8A%E7%BD%91%E7%9A%84%E8%AE%BE%E7%BD%AE%E6%96%B9%E5%BC%8F/index.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://ming.theyan.gs/2017/12/CentOS%207%20%E4%B8%8B%E9%87%8D%E7%BD%AE%20root%20%E5%AF%86%E7%A0%81%E7%9A%84%E6%AD%A5%E9%AA%A4/index.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="老杨">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="运维烂笔头">
      <meta itemprop="description" content="好记性比不过烂笔头">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content=" | 运维烂笔头">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2017/12/CentOS%207%20%E4%B8%8B%E9%87%8D%E7%BD%AE%20root%20%E5%AF%86%E7%A0%81%E7%9A%84%E6%AD%A5%E9%AA%A4/index.html" class="post-title-link" itemprop="url">CentOS 7 下重置 root 密码的步骤</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2017-12-31 15:51:20" itemprop="dateCreated datePublished" datetime="2017-12-31T15:51:20+08:00">2017-12-31</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2019-04-05 07:47:06" itemprop="dateModified" datetime="2019-04-05T07:47:06+08:00">2019-04-05</time>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h1 id="缘起"><a href="#缘起" class="headerlink" title="缘起"></a>缘起</h1><p>起因自然是我厂某台 CentOS 7.x 的机器需要重置密码，然后我就想按老套路：重启进单用户，再重设密码。没想到 CentOS 7.x 的系统跟 CentOS 6.x 来说有了很大的变化，于是我又只好翻了下文档，重新学习了一下。以下是具体操作步骤：</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2017/12/CentOS%207%20%E4%B8%8B%E9%87%8D%E7%BD%AE%20root%20%E5%AF%86%E7%A0%81%E7%9A%84%E6%AD%A5%E9%AA%A4/index.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://ming.theyan.gs/2017/12/Linux%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%86%85%E7%BD%91%E5%9F%9F%E5%90%8D%E8%A7%A3%E6%9E%90%E4%BC%98%E5%8C%96%E6%96%B9%E6%A1%88/index.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="老杨">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="运维烂笔头">
      <meta itemprop="description" content="好记性比不过烂笔头">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content=" | 运维烂笔头">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2017/12/Linux%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%86%85%E7%BD%91%E5%9F%9F%E5%90%8D%E8%A7%A3%E6%9E%90%E4%BC%98%E5%8C%96%E6%96%B9%E6%A1%88/index.html" class="post-title-link" itemprop="url">Linux 服务器内网域名解析优化方案</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2017-12-10 15:51:20" itemprop="dateCreated datePublished" datetime="2017-12-10T15:51:20+08:00">2017-12-10</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2019-04-05 07:47:07" itemprop="dateModified" datetime="2019-04-05T07:47:07+08:00">2019-04-05</time>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h1 id="缘起"><a href="#缘起" class="headerlink" title="缘起"></a>缘起</h1><p>这个项目的目的主要是为了解决 Linux<br>服务器在本地解析域名中碰到的几个问题：</p>
<ol>
<li>nameserver 中一部分有故障（包含宕机了）的问题</li>
<li>nameserver 中一部分性能有问题的问题</li>
<li>有 HA，但有时候服务切换没有期望得那样准确、迅速</li>
</ol>
<p>主要为了解决以上三个问题，于是有了内网域名解析优化的需求。</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2017/12/Linux%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%86%85%E7%BD%91%E5%9F%9F%E5%90%8D%E8%A7%A3%E6%9E%90%E4%BC%98%E5%8C%96%E6%96%B9%E6%A1%88/index.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://ming.theyan.gs/2017/10/%E7%A7%91%E5%AD%A6%E4%B8%8A%E7%BD%91%E4%B9%8B-SSR-%E6%96%B9%E6%A1%88/index.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="老杨">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="运维烂笔头">
      <meta itemprop="description" content="好记性比不过烂笔头">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content=" | 运维烂笔头">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2017/10/%E7%A7%91%E5%AD%A6%E4%B8%8A%E7%BD%91%E4%B9%8B-SSR-%E6%96%B9%E6%A1%88/index.html" class="post-title-link" itemprop="url">科学上网之 SSR 方案</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2017-10-21 15:12:23" itemprop="dateCreated datePublished" datetime="2017-10-21T15:12:23+08:00">2017-10-21</time>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h1 id="缘起"><a href="#缘起" class="headerlink" title="缘起"></a>缘起</h1><p>最近上面在开会嘛，职能部门也许是要展示下“肌肉”：“不是我搞不了你，我只是平时懒得鸟你。”我猜大概就是这么个原因吧，结果就是：最近这段时间大家的“科学上网”纷纷中招，不好使了。我司原来用的 SS 改良的版本，中招了，至于怎么解决的，不在本篇讨论的范围之内。</p>
<p>我主要说下家里的情况，家里原来也是 SS 方案，这段时间也不行了，通常是早上不通了，改下端口，然后到晚上又不行了，然后又改端口，搞了两次才是反应过来是被盯上了。心中大呼侥幸！这要是不封端口直接封 IP 我可咋整呀？！就冲这点来讲不得不说职能部门真是良心单位哈，值得点个赞！</p>
<h1 id="现有资源"><a href="#现有资源" class="headerlink" title="现有资源"></a>现有资源</h1><ul>
<li>米国 VPS 一台（Ubuntu 16.04）</li>
<li>家里路由器一台（OpenWrt 14.07，bcrm63xx 架构）</li>
</ul>
<p>以前也是这情况，不过以前跑的是 SS，据说 SSR 比 SS 更不容易被 ban，所以这次我的方案是用 SSR 替换掉原来的 SS。</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2017/10/%E7%A7%91%E5%AD%A6%E4%B8%8A%E7%BD%91%E4%B9%8B-SSR-%E6%96%B9%E6%A1%88/index.html#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




    


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="">
    <link itemprop="mainEntityOfPage" href="https://ming.theyan.gs/2017/08/%E7%94%A8%E5%91%BD%E4%BB%A4%E8%A1%8C%E7%94%9F%E6%88%90%E5%AD%97%E7%AC%A6%E7%BB%84%E6%88%90%E7%9A%84%E4%BA%8C%E7%BB%B4%E7%A0%81/index.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="老杨">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="运维烂笔头">
      <meta itemprop="description" content="好记性比不过烂笔头">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content=" | 运维烂笔头">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          <a href="/2017/08/%E7%94%A8%E5%91%BD%E4%BB%A4%E8%A1%8C%E7%94%9F%E6%88%90%E5%AD%97%E7%AC%A6%E7%BB%84%E6%88%90%E7%9A%84%E4%BA%8C%E7%BB%B4%E7%A0%81/index.html" class="post-title-link" itemprop="url">用命令行生成字符组成的二维码</a>
        </h2>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2017-08-13 14:20:36" itemprop="dateCreated datePublished" datetime="2017-08-13T14:20:36+08:00">2017-08-13</time>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
          <h1 id="方法一"><a href="#方法一" class="headerlink" title="方法一"></a>方法一</h1><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">curl qrenco.de/http:\/\/m.theyan.gs</span><br></pre></td></tr></table></figure>
<p>系统输出：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">█████████████████████████████████</span><br><span class="line">█████████████████████████████████</span><br><span class="line">████ ▄▄▄▄▄ █ ▀▀▄  ██▀█ ▄▄▄▄▄ ████</span><br><span class="line">████ █   █ ███ ▄▄▄████ █   █ ████</span><br><span class="line">████ █▄▄▄█ █ ▄▄ █▀▄███ █▄▄▄█ ████</span><br><span class="line">████▄▄▄▄▄▄▄█ █ ▀ █▄▀ █▄▄▄▄▄▄▄████</span><br><span class="line">████ ▄ ██▄▄▀   ██ ▄▀▄   ▄▀█  ████</span><br><span class="line">████▄▀█▀▀ ▄▄▄▀█▄█▀█  █▄ ▀ ▄█▄████</span><br><span class="line">████▄▄▀▀▀▀▄ █ █▄ ▄█▀ █ ▄███▀ ████</span><br><span class="line">████▄▄  ██▄▀ ▀ ▀ ▄ ▄█▄█▀ ▄▄█▄████</span><br><span class="line">████▄▄▄▄█▄▄█ ▄▄██  ▄ ▄▄▄ █▀▄▀████</span><br><span class="line">████ ▄▄▄▄▄ █▀▄▀▄█▀█▀ █▄█ ▄█▀ ████</span><br><span class="line">████ █   █ ██▀ ▄ ▄█ ▄ ▄▄  ▀ ▄████</span><br><span class="line">████ █▄▄▄█ █  █▀ ▄  ▀ █▀ ██▄▄████</span><br><span class="line">████▄▄▄▄▄▄▄█▄████▄▄█▄█▄██▄██▄████</span><br><span class="line">█████████████████████████████████</span><br><span class="line">█████████████████████████████████</span><br></pre></td></tr></table></figure>
<h1 id="方法二"><a href="#方法二" class="headerlink" title="方法二"></a>方法二</h1><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">echo</span> <span class="string">"http://m.theyan.gs"</span> | curl -F-=\&lt;- qrenco.de</span><br></pre></td></tr></table></figure>
<p>得到的系统输出是：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">█████████████████████████████████</span><br><span class="line">█████████████████████████████████</span><br><span class="line">████ ▄▄▄▄▄ █ ▄▄ █ ██▀█ ▄▄▄▄▄ ████</span><br><span class="line">████ █   █ ██▄█▀▀▄████ █   █ ████</span><br><span class="line">████ █▄▄▄█ █ ▀▀▄ ▀▄███ █▄▄▄█ ████</span><br><span class="line">████▄▄▄▄▄▄▄█ ▀▄█▄█▄▀ █▄▄▄▄▄▄▄████</span><br><span class="line">████▄▄ █▀ ▄▀ ▄█▄  ▄▀▄   ▄▀█  ████</span><br><span class="line">████▄▄ ██▄▄  ▄ ▀ █▄  █▄ ▀ ▄█▄████</span><br><span class="line">█████▀▄▄▀█▄▀▄▄ ██ ▄▀ █ ▄███▀ ████</span><br><span class="line">████▄▄ █  ▄▀  ▄▄█▀█▄█▄█▀ ▄▄█▄████</span><br><span class="line">████▄▄▄▄██▄▄▀▄ ▄ ▄█▄ ▄▄▄ █▀▄▀████</span><br><span class="line">████ ▄▄▄▄▄ █▀▄▄▀ ▄ ▀ █▄█ ▄██▄████</span><br><span class="line">████ █   █ ██ ▄██   ▄ ▄▄  ▀▀▄████</span><br><span class="line">████ █▄▄▄█ █ ▀▀▄█▀█ ▀ █▀ ██▄▄████</span><br><span class="line">████▄▄▄▄▄▄▄█▄▄█▄▄▄██▄█▄██▄██▄████</span><br><span class="line">█████████████████████████████████</span><br><span class="line">█████████████████████████████████</span><br></pre></td></tr></table></figure>
<h1 id="检测结果"><a href="#检测结果" class="headerlink" title="检测结果"></a>检测结果</h1><p>用二维码识别软件检测上面这两个二维码，发现都是：“<a href="http://m.theyan.gs”" target="_blank" rel="noopener">http://m.theyan.gs”</a></p>

      
    </div>

    
    
    

    <footer class="post-footer">
        <div class="post-eof"></div>
      
    </footer>
  </article>
</div>




  <nav class="pagination">
    <a class="extend prev" rel="prev" title="上一页" aria-label="上一页" href="/page/7/"><i class="fa fa-angle-left"></i></a><a class="page-number" href="/">1</a><span class="space">&hellip;</span><a class="page-number" href="/page/7/">7</a><span class="page-number current">8</span><a class="page-number" href="/page/9/">9</a><span class="space">&hellip;</span><a class="page-number" href="/page/12/">12</a><a class="extend next" rel="next" title="下一页" aria-label="下一页" href="/page/9/"><i class="fa fa-angle-right"></i></a>
  </nav>

</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">

  <div class="copyright">
    &copy; 
    <span itemprop="copyrightYear">2025</span>
    <span class="with-love">
      <i class="fa fa-heart"></i>
    </span>
    <span class="author" itemprop="copyrightHolder">老杨</span>
  </div>
  <div class="powered-by">由 <a href="https://hexo.io/" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/pisces/" rel="noopener" target="_blank">NexT.Pisces</a> 强力驱动
  </div>

    </div>
  </footer>

  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>
  <div class="sidebar-dimmer"></div>
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up fa-lg"></i>
    <span>0%</span>
  </div>
  <a role="button" class="book-mark-link book-mark-link-fixed"></a>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>

</body>
</html>
